package com.example.file.controller;

import annotation.RequireRoles;
import entity.Rsp;
import com.example.file.service.FileServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class FileController {

    @Autowired
    FileServiceImpl fileService;


//    @RequireRoles(roles = {"admin","super_admin"},index = 2)
    @PostMapping("/uploadImage")
    public Rsp uploadImage(@RequestParam("image") MultipartFile image, @RequestHeader("userId") String userId,
                           @RequestHeader("roleSign") String roleSign){




        return fileService.uploadImage(image);
    }



}
